package com.example.chatzsyproject.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.example.chatzsyproject.R;
import com.example.chatzsyproject.app.MyApplication;
import com.example.chatzsyproject.base.ForResultNestedCompatFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class FragmentFour extends ForResultNestedCompatFragment {
    private View rootView;
    private Unbinder unbinder;

    @BindView(R.id.im_url)
    ImageView im_url;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (null != rootView) {
            ViewGroup parent = (ViewGroup) rootView.getParent();
            if (null != parent) {
                parent.removeView(rootView);
            }
        } else {
            rootView = inflater.inflate(R.layout.fragment_four, null);
        }
        unbinder = ButterKnife.bind(this, rootView);
        initView(rootView);// 控件初始化
        return rootView;
    }

    private void initView(View vievw) {
        Glide.with(MyApplication.getInstance()).load("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1571215845389&di=91bb0746a157533e7031628636eedd02&imgtype=0&src=http%3A%2F%2Fwww.banyingle.com%2Fshop%2Fimages_shop%2F24622%2F2012-01-12%2F69872012112106083970703.jpg").into(im_url);

    }
    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
